<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script type="text/javascript">
		window.onload = function(){//元素节点获取
			//ducument.getElementById();id属性值获得元素节点
			var name = document.getElementById("userName");
			console.log(name);
			var email = document.getElementById("userEmail");
			console.log(email);
			
			//通过getElementByTagName('input');
			var inputs = document.getElementsByTagName('input');
			console.log(inputs);
			console.log(inputs[1]);
		}	
		</script>
		<title></title>
	</head>
	<body>
		<input type="text" id="userName" value="moon"/><br />
		<input type="text" id="userEmail" value="moon@qq.com"/><br />
	</body> 
</html>
